package emulator.hardware.io.peripherals.iec.sim;

public class CompoundState extends MachineState
{
	private StateMachine _subMachine;

	public CompoundState(String name, StateMachine subMachine)
	{
		super(name);
		_subMachine = subMachine;
	}

	@Override
	public MachineState next() throws Exception
	{
		_subMachine.tick();
		return super.next();
	}

	@Override
	public MachineState enter()
	{
		_subMachine.reset();
		return super.enter();
	}
}
